All Questions
Tagged with cacheconcurrency
17 questions
2votes
2answers
179views
Threadsafe LRU Cache
Trying to design a threadsafe lru cache using a reentrant lock. Currently I don't like the tryLock in a loop approach. Any inputs on making it more optimal in terms of concurrency? ...
2votes
1answer
469views
Thread-safe LFU Cache
I am trying to implement a thread-safe LFU cache algorithm, please review my code and would really appreciate some criticism or suggestion. (on naming, design, data structures used, anything) Some ...
1vote
1answer
2kviews
Thread-safe LRU Cache Implementation in Java
I am trying to implement a thread-safe LRU cache algorithm, please review my code and would really appreciate some criticism or suggestion. Some assumptions: capacity will be larger than 0 Some ...
6votes
3answers
4kviews
java Thread-safe LRUCache implementation
What is best way to implement thread-safe LRUCache in java? Please review this one. Is there any better approach which can be taken here? ...
2votes
1answer
249views
Stack for asynchronous processing
The following TaskStack processes input elements asynchronously based on a function that it receives at construction: ...
3votes
2answers
622views
ConcurrentHashQueue in C#
The ConcurrentHashQueue data structure is a FIFO queue that at the same time allows look-ups of items based on a key in O(1) like a dictionary. It can be used as a ...
0votes
1answer
292views
Caching wrapper for digest computation
I need to review this code: ...
6votes
1answer
383views
Can my cache be more thread safe?
I have been working on a cache that can handle multiple reads at the same time, but the write is blocking. Is this code overkill by using both a ConcurrentHashMap ...
1vote
0answers
2kviews
Purging elements from the map if it reaches a memory size limit
I have implemented a LRU cache using ConcurrentLinkedHashMap. In the same map, I am purging events if my map reaches a particular limit as shown below. I have a ...
1vote
1answer
1kviews
Implementation of self-updating, asynchronous cache solution of individual (non-bulk) objects
Here I am again; referring to my previous code review request about a self-updating, asynchronous (?) cache. The previous class takes care of caching operations like "get all users registered in our ...
0votes
2answers
837views
Implementation of asynchronous (?), self-refreshing cache of object collection bulk
I'm trying to create a caching solution used in various parts of a clients' application. The resulting code will be open source. For example, it will be used for caching API queries like "get all ...
4votes
1answer
1kviews
Simple thread-safe loading cache based on RxJava
I'm sketching a simple thread-safe cache which can load missing values. It is based on RxJava's Observable which also means that it should be possible for a client to join a request for value which is ...
3votes
1answer
628views
Reducing lock contention for a caching utility, or make it totally lockless but threadsafe
My Java program is a module called configProxy which fetches configuration entries from a remote node (say from a Redis instance). When the caller calls the ...
7votes
1answer
2kviews
Cache for JSON API
I am working on a small project which utilizes a 3rd party API. Many of the queries from the API can take 5-10 seconds so to keep the front end moving a bit faster I decided to cache the responses ...
7votes
1answer
9kviews
Concurrent LRU cache using sychronizedMap() or ReadWriteLock
Trying to implement a simple, thread-safe LRU cache that's meant for "read mostly" use. Collections.sychronizedMap() Clean, simple, not much else to say. ...